<!doctype html>
<html>

	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../css/mui.css" rel="stylesheet" />
		<link href="../css/common.css" rel="stylesheet" />
		<style>
			.mui-table-view{
				margin-top: 16px;
			}
		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav xq-window-header">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">诗文详情页设置</h1>
		</header>
		<div class="mui-content">
			<ul class="mui-table-view">
				<li class="mui-table-view-cell mui-collapse mui-active">
					<a class="mui-navigate-right">当配图不存在时</a>
					<div class="mui-collapse-content">
						<form class="mui-input-group" id="peitu-sel-form">
							<div class="mui-input-row mui-radio">
								<label>不显示</label>
								<input name="font-sel" type="radio" value="0">
							</div>
							<div class="mui-input-row mui-radio">
								<label>显示默认图</label>
								<input name="font-sel" type="radio" value="1">
							</div>
							<div class="mui-input-row mui-radio">
								<label>显示随机图片</label>
								<input name="font-sel" type="radio" value="2">
							</div>
						</form>
					</div>
				</li>
			</ul>
		</div>
		<script src="../js/mui.js"></script>
		<script src="../js/jquery-3.3.1.js"></script>
		<script src="../js/commonUtils.js"></script>
		<script type="text/javascript">
			mui.init();
			mui.ready(function(){
				if(mui.os.plus){
					return;
				}
				initDetPageSetting();
			});
			mui.plusReady(function () {
				//SettingInfoManager.regiserPageAndSetPageFontFromSetting("about",$('body'));
				initDetPageSetting();
			});
			
			function initDetPageSetting(){
				SettingInfoManager.setPageFontFromSetting();
				//
				mui('#peitu-sel-form').on('change', 'input', function() {
					if (this.checked) {
						var selVal=this.value;
						console.info(selVal);
						SettingInfoManager.setDetPagePeituShowTypeSetting(selVal);
						mui.toast('设置成功',{ duration:'long', type:'div' });
					}
				});
				//
				initDetPagePeituShowSetting();
			}
			
			function initDetPagePeituShowSetting(){
				var selVal = SettingInfoManager.getDetPagePeituShowTypeSetting();
				if(!selVal){
					selVal=2;
					SettingInfoManager.setDetPagePeituShowTypeSetting(selVal);
				}
				$('#peitu-sel-form').find('[value="'+selVal+'"]').attr('checked','true');
			}
		</script>
	</body>

</html>
